<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>联盟商户详情</title>
	<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
	<link href="../../css/bootstrap.min.css" rel="stylesheet">
	<link href="css/nifty.min.css" rel="stylesheet">
	<link href="../../css/demo/nifty-demo-icons.min.css" rel="stylesheet">
	<link href="../../plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<link href="../../css/user_defined.css" rel="stylesheet">
	<link href="../../plugins/pace/pace.min.css" rel="stylesheet">
	<script src="../../plugins/pace/pace.min.js?2016/8/5"></script>
	<script src="../../js/jquery-2.2.1.min.js"></script>
</head>
<body id="main">
<div id="container" class="effect mainnav-lg">
	<div class="boxed">
		<div>
			<div id="page-title">
				<h1 class="page-header text-overflow">联盟商户详情</h1>
			</div>
			<style>
				.panel table td{
					padding:7px 0;
				}
				td , th{
					font-size:18px;
				}
				.panel{
					margin:20px;
				}
				.panel-heading{
					font-weight: 800;
					font-size:20px;
					padding:10px 20px;
					border-bottom:1px solid #efefef;
					height:auto;
					color:#777;
				}
				.panel-heading:after{display:none!important;}
				
				.base_info td:first-child:after{
					content:":";
					padding:0 8px;
				}
				td button{
					margin-left:15px;
				}
			</style>
			<!--城市合伙人基本信息-->
			<div class="panel">
				<div class="panel-heading"><span>基本信息</span></div>
				<div class="panel-body">
					<table class="base_info">
						<tr>
							<td>负责城市</td>
							<td>
								<span v-text="partner.basic_info.city"></span>
							</td>
						</tr>
						<tr>
							<td>营业状态</td>
							<td>
								<span v-text="statuses[partner.basic_info.m_status]"></span>
							</td>
						</tr>
						<tr>
							<td>管理账号</td>
							<td>
								<span v-text="partner.basic_info.m_account"></span>
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			<style>
				.price:after{
					content:"元";
				}
				.date:after{
					content:"天";
				}
			</style>
			<!--城市合伙人数据信息-->
			<div class="panel">
				<div class="panel-heading">数据信息</div>
				<div class="panel-body">
					<table class="base_info">
						<tr>
							<td>钱包余额</td>
							<td>
								<span class="price" v-text="partner.basic_info.m_money"></span>
							</td>
						</tr>
						<tr>
							<td>结算周期</td>
							<td>
								<span class="date" v-text="partner.basic_info.m_settlement_cycle"></span>
							</td>
						</tr>
						<tr>
							<td>订单提成比例</td>
							<td>
								<span v-text="partner.basic_info.m_royalty_ratio"></span>
							</td>
						</tr>
						<tr>
							<td>订单总数</td>
							<td>
								<span>******</span>
							</td>
						</tr>
					</table>
				</div>
			</div>
			
			<!--城市合伙人联盟商户-->
			<style>
				.primary_table{
					width:100%;
				}
				.primary_table th, .primary_table td{
					text-align: center;
					border:1px solid #ccc;
					padding:5px;
				}
				.primary_table th{
					background:#eee;
				}
			</style>
			
			<!--城市合伙人联盟商户-->
			<div class="panel">
				<div class="panel-heading">自由工程师</div>
				<div class="panel-body">
					<table class="primary_table">
						<tr>
							<th>工程师姓名</th>
							<th>绑定手机号</th>
							<th>所属区域</th>
						</tr>
						<tr v-for="ub in partner.have_engineer" v-on:click="openWin(ub);">
							<td v-text="ub.m_name"></td>
							<td v-text="ub.m_account"></td>
							<td v-text=""></td>
						</tr>
					</table>
				</div>
			</div>
			
			<!--城市合伙人联盟商户-->
			<div class="panel">
				<div class="panel-heading">滴滴工程师</div>
				<div class="panel-body">
					<table class="primary_table">
						<tr>
							<th>工程师姓名</th>
							<th>绑定手机号</th>
							<th>所属区域</th>
						</tr>
						<tr v-for="ub in partner.didi_engineer" v-on:click="openWin(ub);">
							<td v-text="ub.m_name"></td>
							<td v-text="ub.m_account"></td>
							<td v-text=""></td>
						</tr>
					</table>
				</div>
			</div>
		</div>
	</div>
@@include('public/footer.html')
<script>
	var memberId = getQueryString("member_id");
	var vue = new Vue({
		el: '#main',
		data: {
			partner:{},
			"cities":[],
			"provinces":[],
			"newmember":null,
			"newpwd":"",
			statuses:["关闭","开启"]
		},
		methods: {
			/*加载城市*/
			loadCity:function(){
				$.post(apiRecycle+"partner.php/Admin/Partner/get_member_city", {
					pid:vue.newmember.province
				}, function(res){
					vue.cities = res.data;
				}, "json");
			},
			
			openWin:function(member){
				var win = window.open("", '', "width=650,scrolling=no,height=400,resizable=0,top=150,left=0");
			},
			
			/*添加城市合伙人*/
			savePartner:function(model){
				$.post(apiRecycle+"partner.php/Admin/Partner/edit_member", vue.newmember, function(res){
					if(res.code==200){
						location.reload();
					} else {
						alert(res.message);
					}
				}, "json");
			},
			
			showModal:function(){
				var baseInfo = vue.partner.basic_info;
				vue.newmember = {
					member_id:baseInfo.member_id,
					m_royalty_ratio:baseInfo.m_royalty_ratio,
					m_status:baseInfo.m_status,
					m_settlement_cycle:baseInfo.m_settlement_cycle
				};
				
				$("#changeCity").modal("show");
			},
			
			/*修改密码*/
			changePwd:function(){
				$.post(apiRecycle+"partner.php/Admin/Partner/edit_member", {
					"m_pwd":vue.newpwd,
					"member_id":vue.partner.basic_info.member_id,
				}, function(res){
					if(res.code==200){
						location.reload();
					} else {
						alert(res.message);
					}
				}, "json");
			},
			
			/*跳转到城市合伙人详情页面*/
			partnerDetail:function(p){
				location.href = "city_partner_detail.html?member_id="+p.member_id;
			}
		},
		ready: function () {
			/*加载合伙人详情*/
			$.post(apiRecycle+"partner.php/Admin/Partner/get_member", {member_id:memberId}, function(res){
				vue.partner = res.data;
			}, "json");
			
			var thiz = this;
			/*获取开发省份*/
			$.get(apiRecycle+"partner.php/Admin/Partner/get_member_province", {}, function(res){
				thiz.provinces = res.data;
				console.log(res);
			}, "json");
		}
	});
</script>
</body>
</html>
